/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package ru.prjpeople.model;

/**
 *
 * @author Vladimir
 */
public class Person {
    private String name = null;
    private String patronymic = null;
    private String lastName = null;
    private Position position;
    private int key;

    private Integer generateKey(){
        return (int)(Math.random() * Integer.MAX_VALUE);
    }

    public Person() {

    }

    public Person(String lastName, String name, String patronymic) {
        this.name = name;
        this.patronymic = patronymic;
        this.lastName = lastName;
        key = generateKey();
    }

    public Person(String lastName,
                  String name,
                  String patronymic,
                  Position position) {
        this.name = name;
        this.patronymic = patronymic;
        this.lastName = lastName;
        this.position = position;
        key = generateKey();
    }
    public void setName(String n) {
        this.name = n;
    }

    public void setPatronymic(String p) {
        this.patronymic = p;
    }
    
    public void setLastName(String ln) {
        this.lastName = ln;
    }

    public void setFullName(String lastName, String name, String patronymic) {
        this.name = name;
        this.patronymic = patronymic;
        this.lastName = lastName;
    }
    
    public void setPosition(Position p) {
        this.position = p;
    }

    public int getKey() {
        return key;
    }

    public String getName() {
        return name;
    }

    public String getPatronymic() {
        return patronymic;
    }

    public String getLastName() {
        return lastName;
    }

    public Position getPosition() {
        return position;
    }

    public String getFullName() {
        return (lastName + " " + name + " " + patronymic);
    }
}
